package org.openmore.opc.service.feignFactory;

import feign.hystrix.FallbackFactory;
import org.openmore.opc.dto.BaseResponse;
import org.openmore.opc.service.WechatMiniService;
import org.springframework.stereotype.Component;

@Component
public class WechatMiniServiceFeignFactory extends BaseFeignFallback implements FallbackFactory<WechatMiniService> {
    @Override
    public WechatMiniService create(Throwable cause) {
        return new WechatMiniService() {
            @Override
            public BaseResponse getJscodeSessionInfo(String tenantId, String code) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getJscodeSessionInfo(String tenantId, String sessionKey, String signature, String rawData, String encryptedData, String iv) {
                return null;
            }

            @Override
            public BaseResponse greetUser(String tenantId, String code) {
                return getFallBackResponse();
            }

            public BaseResponse gotoAuthUrl(String tenantId){
                return getFallBackResponse();
            }

            @Override
            public BaseResponse gotoPreAuthUrl(String tenantId) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse jumpInfo(String tenantId, String authorizationCode) {
                return getFallBackResponse();
            }

            @Override
            public BaseResponse getAuthorizerInfo(String tenantId) {
                return getFallBackResponse();
            }
        };
    }
}
